#ifndef _FASTSTRINGBUFFER_H_
#define _FASTSTRINGBUFFER_H_
#include <QTextStream>

class FastStringBuffer
{
public:
    FastStringBuffer()
    {
        stream.setString(&value);
    }
    FastStringBuffer(const FastStringBuffer& other)
    {
        value = other.value;
        stream.setString(&value);
    }
    virtual ~FastStringBuffer()
    {
    }

    FastStringBuffer append(const QString & str)
    {
        stream << str;
        return *this;
    }

    FastStringBuffer append(int n)
    {
        stream << n;
        return *this;
    }

    FastStringBuffer clear()
    {
        value = "";
        stream.setString(&value);
        return *this;
    }

    QString toString()
    {
        return value;
    }

private:
    QString value;
    QTextStream stream;
};

#endif
